home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!cliffe.demon.co.uk
- From: Steven Chapman <steve@cliffe.demon.co.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: C
- Date: Thu, 18 Jan 96 18:01:21 GMT
- Message-ID: <9601181801.AA0003c@cliffe.demon.co.uk>
- X-NNTP-Posting-Host: cliffe.demon.co.uk
- X-NewsSoftware: GRn 2.1 19/2/94 (PostNews Fix 31/3/95 Martin Hunt)
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
- X-Mail2News-Path: relay-4.mail.demon.net!post.demon.co.uk!cliffe.demon.co.uk
-
-
- I am trying to get this src to compile and work but i need the output
- to go to a file in Ram: and not the CON: window that it opens.
-
- I now that i have too change the file pointer somehow but a can not fine
- out how.
-
- Please Help.
-
-
- **********************
- ToolType PROG=list C:
- **********************
-
-
-
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-
- #include <dos/dos.h>
- #include <dos/dostags.h>
- #include <exec/exec.h>
- #include <intuition/intuition.h>
- #include <libraries/gadtools.h>
- #include <rexx/errors.h>
- #include <rexx/rexxio.h>
- #include <rexx/rxslib.h>
- #include <rexx/storage.h>
-
- #include <clib/dos_protos.h>
- #include <clib/exec_protos.h>
- #include <clib/intuition_protos.h>
- #include <clib/gadtools_protos.h>
- #include <clib/rexxsyslib_protos.h>
- #include <clib/alib_protos.h>
-
- #include <workbench/startup.h>
- #include <workbench/workbench.h>
- #include <workbench/icon.h>
- #include <clib/icon_protos.h>
-
- #define VERSION 33
- #define PRGTEXT "\nProgram: "
- #define ICONTEXT "\nIkon: "
- #define SHELLTEXT "\nStarta ifrn Workbench!\n"
-
- extern struct WBStartup *WBenchMsg;
-
- struct Library *IconBase;
-
- int main(int argc, char **argv)
- {
- struct WBArg *wbarg;
- struct DiskObject *dobj;
- UBYTE **tools,*textp;
- BPTR fh;
- LONG argnum;
-
- if(!argc) {
- if(!(fh = Open("CON:10/10/400/400/WBtest",MODE_NEWFILE)))
- exit(10);
- IconBase = OpenLibrary((UBYTE *)"icon.library",VERSION);
- if(!IconBase) {
- Close(fh);
- exit(10);
- }
- wbarg = WBenchMsg->sm_ArgList;
- argnum = WBenchMsg->sm_NumArgs;
-
- Write(fh,PRGTEXT,strlen(PRGTEXT));
- Write(fh,wbarg->wa_Name,strlen(wbarg->wa_Name));
-
- dobj = GetDiskObject((UBYTE *)wbarg->wa_Name);
- tools = (UBYTE **)dobj->do_ToolTypes;
- textp = FindToolType(tools,(UBYTE *)"PROG");
- Write(fh,textp,strlen(textp));
- printf ("%s",textp);
-
- Execute (textp,fh,0);
- FreeDiskObject(dobj);
-
- for(wbarg++; --argnum; wbarg++) {
- Write(fh,ICONTEXT,strlen(ICONTEXT));
- Write(fh,wbarg->wa_Name,strlen(wbarg->wa_Name));
- }
-
- CloseLibrary(IconBase);
- Delay(200);
- Close(fh);
- }
- else
- Write(Output(),SHELLTEXT,strlen(SHELLTEXT));
- }
-
-
-
-
- --
- =========================================================
- | Steven Chapman - steve@cliffe.demon.co.uk (Private ) |
- | Amiga 4000/030, Workbench 3.1, Kickstart 3, 1 Gig HD |
- | 4 meg Fast Ram, 2 Meg Chip Ram. |
- =========================================================
-
-